﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Web.Mvc;
using QDT.Common;
using QDT.Core.Assignments;
using QDT.Core.Deals;
using QDT.Core.Members;
using QDT.Core.Projects;
using QDT.MVC.Security;
using QDT.Services.Assignments;
using QDT.Services.Credits;
using QDT.Services.Deals;
using QDT.Services.Members;
using QDT.Services.Orders;
using QDT.Services.Projects;
using QDT.Web.Code;
using QDT.Web.Code.Attributes;
using QDT.Web.Code.Enums;
using QDT.Web.Models;

namespace QDT.Web.Moblie.Controllers
{
    [DefaultAuthorize]
    public abstract class UserBaseController : BaseController
    {
        protected new User User { get { return QDTContext.Current.User; } }
    }

    [HttpsRequire]
    public partial class UserController : UserBaseController
    {
        private readonly IUserService _userService;
        private readonly IQureyService _qureyService;

        //payment支付服务
        private static ICreditService CreditService { get { return IoC.Resolve<ICreditService>(); } }
        private static IAssignmentService AssignmentService { get { return IoC.Resolve<IAssignmentService>(); } }



        //订单服务
        private static IOrderService OrderService { get { return IoC.Resolve<IOrderService>(); } }

        public UserController(IUserService userService, IQureyService qureyService)
        {

            if (QDTContext.Current.IsAuthenticated && User.GroupID == 1)
            {
                throw new Exception();
            }

            Check.Argument.IsNotNull(userService, "userService");

            _userService = userService;
            _qureyService = qureyService;
        }

    }
}
